package com.jial08.designpatterns.factory.abst;

import com.jial08.designpatterns.factory.abst.color.Color;
import com.jial08.designpatterns.factory.abst.shape.Shape;
import com.jial08.designpatterns.factory.abst.shape.impl.Circle;
import com.jial08.designpatterns.factory.abst.shape.impl.Square;
import org.apache.commons.lang3.StringUtils;

/**
 * <p>类描述：。</p>
 *
 * @author jl
 * @version v1.0.0.1。
 * @since JDK1.8。
 * <p>创建日期：2019/10/12 下午9:06。</p>
 */
public class ShapeFactory extends AbstractFactory {
	@Override
	public Shape getShape(String shape) {
		if (StringUtils.isBlank(shape)) {
			return null;
		}
		if ("circle".equalsIgnoreCase(shape)) {
			return new Circle();
		} else if ("square".equalsIgnoreCase(shape)) {
			return new Square();
		}
		return null;
	}

	@Override
	public Color getColor(String color) {
		return null;
	}
}
